package com.wujilee.wujileenetty.demos.web.nio;

import java.io.FileInputStream;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;

/**
 * @author liwuji
 * @date 2024/7/30
 * @desc
 **/
public class MappedByteBufferTest {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("/Users/liwuji/demo.txt");
        FileChannel channel = fileInputStream.getChannel();
        MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0, 5);
        map.put(0,(byte) 1);
        fileInputStream.close();
    }
}
